<?php 

	$actionParams = array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'out_articles');

?>
<form action="<?=MozgRoute::Get('http')->Create($actionParams, false, $leftParams);?>" method="get">
<div style="padding: 15px;">
<?php 
if (!$this->blog->GetId())
{
?>
	<div class="filter-row">
		По категориям<br>
		<table width="100%">
			<tr>
				<td><input type="radio" name="filter_category" value="0" <?php echo (!$this->filter->GetCategory() ? ' checked' : ''); ?>></td>
				<td>Все</td>
			</tr>	
<?php 
	foreach ($this->newsCategoryIds as $catId)
	{
		$cat = $this->structMapper->GetById($catId);
		if (!$cat) continue;
?>
			<tr>
				<td width="1%"><input id="article_cat_<?php echo $cat->GetId(); ?>" type="radio" name="filter_category" value="<?php echo $cat->GetId(); ?>"<?php echo ($this->filter->GetCategory() == $cat->GetId() ? ' checked' : ''); ?>></td>
				<td><label for="article_cat_<?php echo $cat->GetId(); ?>" class="label-left"><small><?php
		$parentCatIds = $this->structMapper->GetParentElementsIds($cat->GetId());
		foreach ($parentCatIds as $pCatId)
		{
			$pCat = $this->structMapper->GetById($pCatId);	
			echo $pCat->GetName(). ' &gt; ';
		}
		?></small><?php echo $cat->GetName(); ?></label></td>
			</tr>
<?php	
	}
?>			
		</table>
	</div>
<?php 
}
?>		
	<div id="tagsSuggest" class="tagBox filter-row">
		По тэгам<br>
		<input name="filter_tags" id="tags" class="tagBoxInput" type="text" value="<?=htmlspecialchars($this->filter->GetTags());?>" style="width: 100%;">
	</div>	
	<div class="filter-row">
		Начиная с даты<br>
		<input name="filter_from_date" type="text" value="<?=htmlspecialchars($this->filter->GetFromDate() ? $this->filter->GetFromDate() : '');?>">
	</div>	
	<div class="filter-row">
		Заканчивая датой<br>
		<input name="filter_to_date" type="text" value="<?=htmlspecialchars($this->filter->GetToDate() ? $this->filter->GetToDate() : '');?>">
	</div>	
	<?=$this->Style()->IncludeStyleFile(array('js' => 'tagdragon'));?>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#tagsSuggest').tagdragon({'field':'tags',
			 'max':10,
			 'charMin':2,
			 'url':'<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'tags_list', 'blog' => $this->blog->GetId()));?>'});	 
	});
	</script>
	<table>
		<tr>
			<td class="r"><input type="submit" class="bt" value="Искать" /></td>
			<td class="l"><input type="button" value="Сбросить" class="bt"
				onClick="window.location.href='<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => $this->ctrlName, 'action' => 'out_articles', 'blog' => $this->blog->GetId(), 'resetfilter' => 1));;?>';" /></td>
		</tr>
	</table>
</div>
<input type="hidden" name="blog" value="<?=$this->blog->GetId();?>">
<?=MozgRoute::Get('http')->CreateInputs($leftParams);?>
</form>